<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\modules\home\models\Article */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="article-form">

    <div class="row">
        <?php $form = ActiveForm::begin(); ?>

        <div class="col-md-8">

            <div class="form-group">
                <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
            </div>

            <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'type')->dropDownList(['1' => '论文分类', '0'=>'单页面',]) ?>

            <?= $form->field($model, 'cid')->dropDownList($catelist) ?>

            <?= $form->field($model, 'content')->widget('common\widgets\ueditor\Ueditor',[
                'options'=>[
                    // 'initialFrameWidth' => '100%',
                ]
            ]) ?>
        </div>

        <div class="col-md-4">

            <?= $form->field($model, 'order')->textInput()->label('排序 ：<span style="color:red;">[ 数字越大越排序越靠前 ]</span>') ?>
            <?= $form->field($model, 'status')->dropDownList(['1'=>'发布中','0'=>'未发布']) ?>

            <?php if(!$model->publish_date){ ?>
            <?= $form->field($model, 'publish_date')->textInput(['maxlength' => true, 'type' => 'date', 'value' => date('Y-m-d')]) ?>
            <?php }else{ ?>
            <?= $form->field($model, 'publish_date')->textInput(['maxlength' => true, 'type' => 'date']) ?>
            <?php }?>

            <?= $form->field($model, 'summary')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'author')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'read')->textInput() ?>

            <?= $form->field($model, 'is_hot')->textInput() ?>

            <?= $form->field($model, 'is_recommend')->textInput() ?>

            <?= $form->field($model, 'tag')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'image_path')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'url')->textInput(['maxlength' => true]) ?>
        </div>


    <?php ActiveForm::end(); ?>
    </div>

</div>
